/**
 * 
 */
package org.xserver;

import java.io.File;

import org.apache.commons.io.FilenameUtils;
import org.apache.commons.lang.SystemUtils;

/**
 * @author jkonopka
 * 
 */
public final class Application {

	/**
	 * 
	 */
	private Application() {
	}

	/**
	 * @return user path
	 */
	public static String getUserPath() {
		final File file = SystemUtils.getUserHome();
		return FilenameUtils.concat(file.getAbsolutePath(), ".xserver");
	}

	/**
	 * @return user configuration path
	 */
	public static String getUserConfPath() {
		return FilenameUtils.concat(getUserPath(), "conf");
	}

	/**
	 * @return application library path
	 */
	public static String getAppLibPath() {
		return FilenameUtils.concat(getAppPath(), "lib");
	}

	/**
	 * @return user settings filename
	 */
	public static String getUserSettingsFilename() {
		return FilenameUtils.concat(getUserConfPath(), "settings.xml");
	}

	/**
	 * @return application path
	 */
	public static String getAppPath() {
		return SystemUtils.getUserDir().getAbsolutePath();
	}

	/**
	 * @return plugin path
	 */
	public static String getPluginPath() {
		return FilenameUtils.concat(getAppPath(), "plugins");
	}

}
